package com.ssm.service.impl;

import com.ssm.dao.SectionDao;
import com.ssm.entity.Section;
import com.ssm.service.SectionService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("sectionService")
public class SectionServiceImpl implements SectionService {

    @Resource
    private SectionDao sectionDao;

    @Override
    public void addSection(Section section) {
        sectionDao.insertSection(section);
    }

    @Override
    public void updateSection(Section section) {
        sectionDao.updateSection(section);
    }

    @Override
    public void removeBatchSection(Integer[] ids) {
        sectionDao.deleteBatchSection(ids);
    }

    @Override
    public List<Section> listSection(Section section) {
        return sectionDao.selectSection(section);
    }


    @Override
    public Section getSection(Integer id) {
        return sectionDao.selectOneSection(id);
    }

    @Override
    public int selectSectionByname(String name) {
        return sectionDao.selectSectionByname(name);
    }
}
